<template>
  <div>

    <WaybillCheckInfo
      @closeWaybillCheckInfo="closeWaybillCheckInfo"
      :billInfo="billInfo"
      v-if="showInfoFlag"
    />
    <keep-alive>
    <WaybillCheckList @rowServiceInfo="rowServiceInfo" v-if="!showInfoFlag" />
    </keep-alive>
  </div>
</template>

<script>
import WaybillCheckInfo from "./WaybillCheckInfo.vue";
import WaybillCheckList from "./WaybillCheckList.vue";
export default {
  components: {
    WaybillCheckInfo,
    WaybillCheckList,
  },
  data() {
    return {
      showInfoFlag: false,
      billInfo: null,
    };
  },
  methods: {
    rowServiceInfo(record) {
      this.billInfo = record;
      if ((this.billInfo ?? "") != "") {
        this.showInfoFlag = true;
      }
    },
    closeWaybillCheckInfo() {
      this.showInfoFlag = false;
    },
  },
};
</script>

<style lang="less" scoped>
</style>